package p.ithorns.framework.redis.stream.serializer;

import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;

import java.nio.charset.StandardCharsets;
import java.util.Objects;

/**
 * RedisKeySerializer
 *
 * @author ithorns
 * @version 1.0.0
 * @date 2022/12/10 15:52
 */
public class StreamKeySerializer extends StringRedisSerializer {

    @Override
    public byte[] serialize(@Nullable String key) {
        return Objects.requireNonNull(key).getBytes(StandardCharsets.UTF_8);
    }

}
